package com.wyclabs.gateway.auth;

import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.server.WebFilterExchange;
import org.springframework.security.web.server.authentication.ServerAuthenticationFailureHandler;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;

/**
 * 鉴权失败处理器
 * @author rs
 * @date 2019/11/13 11:14
 *
 */
@Component
public class AuthenticationFailHandler implements ServerAuthenticationFailureHandler {

    /**
     * Invoked when authentication attempt fails
     * @param webFilterExchange the exchange
     * @param exception         the reason authentication failed
     * @return a completion notification (success or error)
     */
    @Override
    public Mono<Void> onAuthenticationFailure(WebFilterExchange webFilterExchange, AuthenticationException exception) {
        return null;
    }
}
